AddCSLuaFile( "cl_init.lua" )
AddCSLuaFile( "shared.lua" )

include( 'shared.lua' )

NPCCAR = NPCCAR or {}
function ENT:Initialize()
	self:SetModel( NPCCAR.NPCModel or "models/humans/group01/female_01.mdl" )
	self:SetHullType( HULL_HUMAN )
	self:SetHullSizeNormal( )
	self:SetNPCState( NPC_STATE_SCRIPT )
	self:SetSolid( SOLID_BBOX )
	self:CapabilitiesAdd( bit.bor(CAP_ANIMATEDFACE, CAP_TURN_HEAD) )
	self:SetUseType( SIMPLE_USE )
	self:DropToFloor()
 
	self:SetMaxYawSpeed( 90 )
end

function ENT:OnTakeDamage( dmg ) 
	return false
end

function ENT:AcceptInput(name, activator, caller, data)
	if name == "Use" and IsValid(caller) and caller:IsPlayer() then
		umsg.Start("npccar_openmenu", caller)
		umsg.End()
	end
end

hook.Add("PlayerInitialSpawn", "NPCCARDORENDEROVERRIDE", function(ply)
	for k,v in pairs(ents.FindByClass("car_npc")) do
		umsg.Start("doNPCCARrender", ply)
			umsg.Entity(v)
		umsg.End()
	end
end)


